import fitz

#doc = fitz.open('/Users/chenjian/mytest/SLO6.pdf')
fname='/Users/chenjian/mytest/SLO6.pdf'
doc = fitz.open(fname)
out = open(fname + ".txt", "wb")  # open text output
for page in doc:  # iterate the document pages
    text = page.get_text()# get plain text (is in UTF-8)
    print(text)
out.close()
